<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Report extends CI_Controller
{
	function __construct()
	{
		parent::__construct();
		$this->load->model('report/report_model');
        $this->load->language('report', 'vietnam');
	}
    function index()
    {
        if(!$this->session->userdata('username'))
        {
            redirect(site_url('login'));
            die();
        }
        $data = array();
        $uid = $this->session->userdata('uid');
        $info = $this->report_model->ww_get_all_report_by_user($uid);
        $data['info'] = $info;
        $data['report_lang'] = $this->lang->line('report_lang');
        // header
        
        // content
        $this->load->view('report/report_view', $data);
        
        // footer
    }
    function r()
    {
        $data = array();
        $userid = $this->session->userdata('uid');
        $reportid = is_numeric($this->input->get('id')) ? $this->input->get('id') : 0;
        $report = $this->report_model->ww_get_report_by_user($userid, $reportid);
        // header
        
        // content
        $this->load->view('report/read_report_view', $data);
        
        // footer
    }
 }